<div class="row row-cards">

  <div class="col-6 col-sm-4 col-lg-2">
    <div class="card">
      <div class="card-body p-3 text-center">
        <div class="text-right">
          100% valid
        </div>
        <div class="h1 m-0"><%= @checks.count %></div>
        <div class="text-muted mb-4">Checks</div>
      </div>
    </div>
  </div>

  <div class="col-6 col-sm-4 col-lg-2">
    <div class="card">
      <div class="card-body p-3 text-center">
        <div class="text-right <%= class_for_healthy(@checks.percentage_active) %>">
          <%= @checks.percentage_active %>% active
        </div>
        <div class="h1 m-0  <%= class_for_healthy(@checks.percentage_active) %>"><%= @checks.active.count %></div>
        <div class="text-muted mb-4">Checks active</div>
      </div>
    </div>
  </div>

  <div class="col-6 col-sm-4 col-lg-2">
    <div class="card">
      <div class="card-body p-3 text-center">
        <div class="text-right <%= class_for_healthy(@checks.percentage_healthy) %>">
          <%= @checks.percentage_healthy %>% healthy
        </div>
        <div class="h1 m-0 <%= class_for_healthy(@checks.percentage_healthy) %>"><%= @checks.healthy.count %></div>
        <div class="text-muted mb-4">Checks healthy</div>
      </div>
    </div>
  </div>

</div>

<div class="row row-cards">
  <div class="col-12 col-sm-8 col-lg-6">
    <div class="card">
      <div class="card-header">
        <h2 class="card-title">Active checks</h2>
      </div>
      <table class="table card-table table-vcenter">
        <tbody>
          <tr>
            <td class="text-<%= class_for_status('100') %>">Status 1xx</td>
            <td class="text-right">
               <span class="stamp stamp-sm bg-<%= class_for_status('100') %>"><%= @checks.status_1xx.count %></span>
            </td>
          </tr>
          <tr>
            <td class="text-<%= class_for_status('200') %>"><strong>Status 2xx</strong></td>
            <td class="text-right">
              <span class="stamp stamp-sm bg-<%= class_for_status('200') %>"><%= @checks.status_2xx.count %></span>
            </td>
          </tr>
          <tr>
            <td class="text-<%= class_for_status('300') %>"><strong>Status 3xx</strong></td>
            <td class="text-right">
              <span class="stamp stamp-sm bg-<%= class_for_status('300') %>"><%= @checks.status_3xx.count %></span>
            </td>
          </tr>
          <tr>
            <td class="text-<%= class_for_status('400') %>"><strong>Status 4xx</strong></td>
            <td class="text-right">
              <span class="stamp stamp-sm bg-<%= class_for_status('400') %>"><%= @checks.status_4xx.count %></span>
            </td>
          </tr>
          <tr>
            <td class="text-<%= class_for_status('500') %>"><strong>Status 5xx</strong></td>
            <td class="text-right">
              <span class="stamp stamp-sm bg-<%= class_for_status('500') %>"><%= @checks.status_5xx.count %></span>
            </td>
          </tr>
          <tr>
            <td class="text-<%= class_for_status('err') %>">Status error</td>
            <td class="text-right">
              <span class="stamp stamp-sm bg-<%= class_for_status('err') %>"><%= @checks.status_err.count %></span>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
